package com.itheima.mybytestream1;

import java.io.FileOutputStream;
import java.io.IOException;

public class ByteStreamDemo2 {
    public static void main(String[] args) throws IOException {

        //创建对象
        FileOutputStream fos = new FileOutputStream("a.txt",true );

        //批量写入数据
        String str1 = "yanxurui";
        byte[] bytes1 = str1.getBytes();
        fos.write(bytes1);

        //实现换行
        String str2 = "\r\n";
        byte[] bytes2 = str2.getBytes();
        fos.write(bytes2);

        //批量写入数据
        String str3 = "ouyangnana";
        byte[] bytes3 = str3.getBytes();
        fos.write(bytes3);
        fos.close();

    }
}
